package cn.etgps.etgps.event;


import org.greenrobot.eventbus.EventBus;

import cn.etgps.etgps.utils.L;


/**
 * Created by xiaoyu on 2016/3/16.
 */
public class EventBusSendFactory {
    public final static String TAG = "EventBusSendFactory";

    public static void sendEvent(EventSendEntity sendEntity) {
        L.e(TAG, "sendEvent");
        newPostThread(sendEntity);
    }

    public static void receiveEvent(EventReceiveEntity receiveEntity) {
        L.e(TAG, "receiveEvent");
        newPostThread(receiveEntity);
    }

    public static void oilLogEvent(EventOilLogEntitiy oilLogEntitiy) {
        L.e(TAG, "oilLogEvent");
        newPostThread(oilLogEntitiy);
    }

    public static void expenseEvent(EventExpenseEntity entity) {
        L.e(TAG, "expenseEvent");
        newPostThread(entity);
    }

    /**
     * 开启新的线程去发送消息
     **/
    public static void newPostThread(final Object obj) {
        EventBus.getDefault().post(obj);
    }
}
